package cn.tedu.front.details.controller;

import cn.tedu.common.web.JsonResult;
import cn.tedu.front.details.pojo.vo.JobVO;
import cn.tedu.front.details.service.IJobService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.constraints.Range;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/job")
@Validated
@Api(tags = "1.职位描述")
public class JobController {
    @Autowired
    private IJobService jobService;
    @GetMapping("/v1/jobDetail/{id}")
    @ApiOperation("根据ID查询职位描述文章")
    @ApiOperationSupport(order = 410)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "职位文章ID", required = true, dataType = "long")

    })
    public JsonResult getStandardById(
             @Range(min = 1, message = "请提交有效的文章ID值！")@PathVariable Long id) {
        log.debug("开始处理【根据ID查询文章】的请求，参数：{}", id);
        JobVO queryResult = jobService.getStandardById(id);

        return JsonResult.ok(queryResult);
    }


}
